package com.lsus.golkhadi.client;

import com.allen_sauer.gwt.dnd.client.PickupDragController;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.lsus.golkhadi.client.images.GolkhadiImageBundle;
import com.lsus.golkhadi.client.viewsImpl.LoginPanel;
import com.lsus.golkhadi.client.viewsImpl.MainPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Golkhadi implements EntryPoint {
	
	public static PickupDragController dragController;
	
	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		Golkhadi.dragController = new PickupDragController(RootPanel.get(), false);
		MainPanel m = new MainPanel();
		LoginPanel l = new LoginPanel();
		RootPanel.get().setPixelSize(1200, 700);
		HorizontalPanel header = new HorizontalPanel();
		Image headerImage = new Image(GolkhadiImageBundle.INSTANCE.Header());
		header.add(headerImage);
		header.add(l);
		header.setWidth("1280");

		DockLayoutPanel p = new DockLayoutPanel(Unit.PX);
		p.addNorth(header, 100);
		p.addSouth(new HTML(""), 10);
		p.addWest(new HTML(""), 200);
		p.addEast(new HTML(""), 200);
		p.add((Widget)m);
		
		RootLayoutPanel.get().add(p);

		Window.setTitle("Golkhadi");
		
	}
}
